home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
LANG
/
C
/
LIB
/
DESK
/
CORE
/
Desk
/
h_doc
/
Pane2
< prev
next >
Wrap
Text File
|
1996-05-21
|
10KB
|
246 lines
/*
#### # # # #
# # # # # The FreeWare C library for
# # ## ### # # # # ### RISC OS machines
# # # # # # # # # # # ___________________________________
# # #### ### ## # # # #
# # # # # # # # # # Please refer to the accompanying
#### ### #### # # ##### # ### documentation for conditions of use
________________________________________________________________________
File: Pane2.h
Author: Copyright © 1995 Andrew Sellors.
Version: 1.04 (4th August 1995)
Purpose: Handles windows with panes.
Mods: 1.02 -> 1.04
Added Desk_pane2_MAINRIGHT, Desk_Pane2_GetMainHandle, Desk_Pane2_GetPaneNumber,
Desk_Pane2_OpenWindow, Desk_Pane2_ReadVars, Desk_Pane2_SetVars.
*/
/*
NOTES:
Desk_pane2_PANETOP attaches the pane to the main window using the top left of the pane
window rather than the bottom left corner.
Desk_pane2_MAINTOP makes the pane move relative to the top of the main window rather than
the bottom corner.
Desk_pane2_MAINRIGHT makes the pane move relative to the right of the main window rather
than the left.
Desk_pane2_FIXED forces the offset between the pane and the main windows to be constant,
the pane is not allowed to move relative, with it off you get !ArtWork
style pane windows.
Desk_pane2_HRESIZE makes the right and side of the pane be cliped to the right hand side
of the main window if the main window is smaller than the pane.
Desk_pane2_HSTRETCH when used in conjunction with Desk_pane2_HRESIZE makes the right hand side
of the pane always follow the right hand side of the main window.
Desk_pane2_VRESIZE is like Desk_pane2_HREISZE except in the horizontal direction.
Desk_pane2_VSTRETCH is like Desk_pane2_HSTRETCH except in the horizontal direction.
Desk_pane2_HSCROLL makes the pane scroll with the main window in the horizontal direction.
Desk_pane2_VSCROLL makes the pane scroll with the main window in the vertical direction.
*/
#ifndef __Desk_Pane2_h
#define __Desk_Pane2_h
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __Desk_WimpSWIs_h
#include "Desk.WimpSWIs.h"
#endif
#ifndef __Desk_Window_h
#include "Desk.Window.h"
#endif
#ifndef __Desk_Core_h
#include "Desk.Core.h"
#endif
#ifndef __Desk_Wimp_h
#include "Desk.Wimp.h"
#endif
typedef union {
int value;
struct {
unsigned int panetop :1; /* pane is linked using the top of the pane window */
/* else bottom is used */
unsigned int maintop :1; /* pane is fixed to top of main else fixed to bottom */
unsigned int fixed :1; /* pane cannot be moved relative to main window */
unsigned int hresize :1; /* pane is resized to match width of main window up to */
/* pane width */
unsigned int hstretch :1; /* pane width is ignored when resizing */
unsigned int vresize :1; /* pane is resized to match height of main window up */
/* to pane height */
unsigned int vstretch :1; /* pane height is ignored when resizing */
unsigned int hscroll :1; /* pane scrolls horizontally with the main window */
unsigned int vscroll :1; /* pane scrolls vertically with the main window */
unsigned int mainright :1; /* pane is fixed to right of main instead of left */
unsigned int dummy :22;
} data;
} Desk_pane2_flags;
#define Desk_pane2_PANETOP 0x0001
#define Desk_pane2_MAINTOP 0x0002
#define Desk_pane2_FIXED 0x0004
#define Desk_pane2_HRESIZE 0x0008
#define Desk_pane2_HSTRETCH 0x0010
#define Desk_pane2_VRESIZE 0x0020
#define Desk_pane2_VSTRETCH 0x0040
#define Desk_pane2_HSCROLL 0x0080
#define Desk_pane2_VSCROLL 0x0100
#define Desk_pane2_MAINRIGHT 0x0200
/*
* initialises 'mainwindow' with the library as a main window that can have
* panes attached to it.
*/
extern Desk_bool Desk_Pane2_AddMain(Desk_window_handle mainwindow);
/*
* Creates window as Desk_Window_Create and initialises it with the library as a
* main window that can have panes attached to it.
* The window handle is returned or 0 if window cannot be created.
*/
extern Desk_window_handle Desk_Pane2_CreateAndAddMain(const char *windowname, int maxtitlesize);
/*
* Adds the pane window 'panewindow' to the main window 'mainwindow'.
* If 'paneoffset' is not NULL then this is taken as the offset between the
* pane and the main window instead of the positions in the template.
* If 'panesize' is not NULL then this is taken as the size of the pane
* instead of the size in the template.
*/
extern Desk_bool Desk_Pane2_AddPane(Desk_window_handle mainwindow, Desk_window_handle panewindow,
const Desk_wimp_point *paneoffset, const Desk_wimp_point *panesize, int flags);
/*
* Creates pane window as Desk_Window_Create and adds to the main window
* 'mainwindow'.
* If 'paneoffset' is not NULL then this is taken as the offset between the
* pane and the main window instead of the positions in the template.
* If 'panesize' is not NULL then this is taken as the size of the pane
* instead of the size in the template.
* The window handle is returned or 0 if window cannot be created.
*/
extern Desk_window_handle Desk_Pane2_CreateAndAddPane(const char *windowname, int maxtitlesize,
Desk_window_handle mainwindow,
const Desk_wimp_point *paneoffset,
const Desk_wimp_point *panesize,
int flags);
/*
* Opens the main window 'mainwindow' and all it's attached pane windows
* according to 'openpos'
* Use in the same manner to Desk_Window_Show
*/
extern void Desk_Pane2_Show(Desk_window_handle mainwindow, Desk_window_openpos openpos);
/*
* Closes the window 'mainwindow' (removes it from screen) and all it's panes
* Use in the same manner to Desk_Window_Hide
*/
extern void Desk_Pane2_Hide(Desk_window_handle mainwindow);
/*
* This hides and deletes the window 'mainwindow' and all it's panes
* Use in the same manner to Desk_Window_Delete
*/
extern void Desk_Pane2_Delete(Desk_window_handle mainwindow);
/*
* Calculates the pane offset and size so that the pane will be in the same
* position and size as the icon in the window.
* If 'panewindow' is the name of the pane window in the template file then the
* presence of any scroll bars or the window title bar is taken into accound
* when calculating the position and size of the pane, set it to NULL and no
* action is taken.
* Need to use Desk_pane2_MAINTOP and Desk_pane2_PANETOP flags.
*/
extern void Desk_Pane2_ReadIcon(Desk_window_handle window, Desk_icon_handle icon, const char *panewindow,
Desk_wimp_point *paneoffset, Desk_wimp_point *panesize);
/*
* Sets flags of 'panenumber'th pane attached to the window 'main' or NULL
* if the 'panenumber' is invalid.
* First pane is number 1.
* Returns flags and if 'flags' is -1 then they are left unchanged
*/
extern int Desk_Pane2_SetFlags(Desk_window_handle mainwindow, int panenumber, int flags);
/*
* Returns window handle of 'panenumber'th pane attached to the window 'main'
* or 0 if not found.
*/
extern Desk_window_handle Desk_Pane2_GetPaneHandle(Desk_window_handle mainwindow, int panenumber);
/*
* Returns window handle of main window which 'panewindow' is attached to
* or 0 if not found.
*/
extern Desk_window_handle Desk_Pane2_GetMainHandle(Desk_window_handle panewindow);
/*
* Returns pane number of 'panewindow' attatched to 'mainwindow' or 0 if the
* window was not found.
*/
extern int Desk_Pane2_GetPaneNumber(Desk_window_handle mainwindow, Desk_window_handle panewindow);
/*
* This hides and deletes the 'panenumber'th pane attached to the window
* 'mainwindow'
*/
extern void Desk_Pane2_DeletePane(Desk_window_handle mainwindow, int panenumber);
/*
* Calls Desk_Wimp_OpenWindow for the mainwindow and all its panes as if it was
* send an openwindow request.
* If 'openblock' is NULL then the current state of the main window is used.
* Supplying an openblock allows the main window to be changed and the panes to be
* altered to match.
* Can be used to make a pane window appear that has been added to an open mainwindow.
*/
extern Desk_bool Desk_Pane2_OpenWindow(Desk_window_handle mainwindow, const Desk_window_openblock *openblock);
/*
* Returns paneoffset if 'paneoffset' is not NULL and panesize if 'panesize' is
* not NULL for the 'panenumber'th pane attatched to 'mainwindow'.
* Desk_bool_TRUE is returned for success.
*/
extern Desk_bool Desk_Pane2_ReadVars(Desk_window_handle mainwindow, int panenumber,
Desk_wimp_point *paneoffset, Desk_wimp_point *panesize);
/*
* Sets paneoffset if 'paneoffset' is not NULL and panesize if 'panesize' is
* not NULL for the 'panenumber'th pane attatched to 'mainwindow'.
* Desk_bool_TRUE is returned for success.
* After changing the variables, Desk_Pane2_OpenWindow must be used to make the
* windows on screen exhibit the changes.
*/
extern Desk_bool Desk_Pane2_SetVars(Desk_window_handle mainwindow, int panenumber,
const Desk_wimp_point *paneoffset, const Desk_wimp_point *panesize);
#ifdef __cplusplus
}
#endif
#endif